/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package transaction_manager_ws;

import javax.ejb.EJB;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import transaction_manager_core.TransactionManagerCore;

/**
 *
 * @author iMarshall
 */
@WebService()
public class TransactionManagerWS {
    @EJB
    private TransactionManagerCore ejbRef;// Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Web Service Operation")

    @WebMethod(operationName = "openTransaction")
    public String openTransaction() {
        return ejbRef.openTransaction();
    }

    @WebMethod(operationName = "closeTransaction")
    public boolean closeTransaction(@WebParam(name = "tID")
    String tID) {
        return ejbRef.closeTransaction(tID);
    }

    @WebMethod(operationName = "abortTransaction")
    public boolean abortTransaction(@WebParam(name = "tID")
    String tID) {
        return ejbRef.abortTransaction(tID);
    }

    @WebMethod(operationName = "join")
    public boolean join(@WebParam(name = "tID")
    String tID, @WebParam(name = "pID")
    String pID) {
        return ejbRef.join(tID, pID);
    }

    @WebMethod(operationName = "haveCommitted")
    @Oneway
    public void haveCommitted(@WebParam(name = "tID")
    String tID, @WebParam(name = "pID")
    String pID) {
        ejbRef.haveCommitted(tID, pID);
    }

}
